Page({
  data: {
    logs: []
  },
  onLoad: function () {
    this.setData({
      logs: (wx.getStorageSync('logs') || []).map(log => {
        return util.formatTime(new Date(log))
      })
    })
  },
  getaddress: function (res) {
    var that = this;
    wx.chooseAddress({
      success: function (res) {
        console.log(res)
        var detail = that.data.detail;
        detail.username = res.userName;
        detail.dianhua = res.telNumber;
        detail.province = res.provinceName;
        detail.city = res.cityName;
        detail.area = res.countyName;
        detail.dizhi = res.detailInfo;
        that.setData({
          detail: detail
        })
        //获取到的地址保存到服务器上面
        // e.post("member/address/submit", {
        //   realname: res.userName,
        //   mobile: res.telNumber,
        //   province: res.provinceName,
        //   city: res.cityName,
        //   area: res.countyName,
        //   address: res.detailInfo
        // }, function (o) {

        // })
      },
      fail: function (res) {
        console.log(res)
      }
    })
  }
})
